package masterjava.common.client.gwt.rpc;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import masterjava.common.shared.rpc.CustomRemoteService;
import masterjava.common.shared.rpc.CustomRemoteServiceAsync;
import masterjava.common.shared.rpc.Request;
import masterjava.common.shared.rpc.Response;

/**
 * User: gkislin
 * Date: 7/26/11
 */
public class CustomRpc {
    private static final CustomRemoteServiceAsync SERVICE = GWT.create(CustomRemoteService.class);

    public static <T extends Response> void send(Request request, AsyncCallback<T> callback) {
        GWT.log("Send " + request.getClass().getName() + " to server");
        SERVICE.send(request, callback);
    }
}